import random
import os
import numpy as np
import torch
import yaml
import pathlib
project_path = pathlib.Path(__file__).parent
SEED=0
def setup_seed(seed):
    random.seed(seed)
    os.environ['PYTHONHASHSEED'] = str(seed)
    np.random.seed(seed)
    torch.manual_seed(seed)
    torch.cuda.manual_seed(seed)
    torch.cuda.manual_seed_all(seed) # if you are using multi-GPU.
    torch.backends.cudnn.benchmark = False
    torch.backends.cudnn.deterministic = True

dataset = 'demo'

def load_yaml(yaml_path):
    with open(yaml_path, 'r', encoding='utf-8') as f:
            config = yaml.safe_load(f)
    return config

YAML_CONFIG = load_yaml(project_path/'config.yml')[dataset]